package session1.test.ioTest;

import java.io.FileInputStream;
import java.io.ObjectInputStream;

public class Input {
	public static void main(String[] args) {
		try {
			ObjectInputStream objectInputStream =
					new ObjectInputStream(
					new FileInputStream("test.txt")
			);
			while (true){
				try{
					Coo coo = (Coo) objectInputStream.readObject();
					System.out.println(coo.x + "\t" + coo.y);
				}
				catch (RuntimeException runtimeException){
					System.out.println(runtimeException.getMessage());
				}
			}
		}catch (Throwable t){
			System.out.println(t.getMessage());
		}
	}
}
